package com.join;

import java.util.Random;

//利用join 连接线程
public class JoinTest {
	
	public static void main(String[] args) throws InterruptedException {
		int[] array=new int[100000];
		for (int i = 0; i < array.length; i++) {
			array[i]=new Random().nextInt();
		}
		
		SortThread t=new SortThread(array);
		t.start();
		System.out.println("等待排序线程完成");
		t.join();//等待排序线程完成
		
		
		System.out.println(t);
		System.out.println("min:"+array[0]);
		System.out.println("mid:"+array[array.length/2]);
		System.out.println("max:"+array[array.length-1]);
		
	}
	
	
	
}
